global !p

from mdtex.scopes import math, display_math

endglobal

################################################################
#                                                              #
#                            Styles                            #
#                                                              #
################################################################

# #ff0099: 亮粉色
# #da6904: 橙褐色
# #05aa94: 青蓝色
context "math()"
snippet clr "颜色 Color" w
\textcolor{${1|ff0099,da6904,05aa94|}}{${2:${VISUAL}}}$0
endsnippet

context "display_math()"
snippet cbox "定理盒子 Theorem Box" w
\fcolorbox{#FF69B4}{trasparent}{$${1:${VISUAL}}$}$0
endsnippet

context "math()"
snippet "([a-zA-Z]+)rm" "直立罗马体 Upright Roman Font" r
\mathrm{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet rm "直立罗马体 Upright Roman Font" w
\mathrm{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)bb" "缕空粗体 Blank Bold Font" r
\mathbb{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet bb "缕空粗体 Blank Bold Font" w
\mathbb{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)bf" "直立粗体 Upright Bold Font" r
\mathbf{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet bf "直立粗体 Upright Bold Font" w
\mathbf{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)cal" "手写体 Calligraphic Font" r
\mathcal{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet cal "手写体 Calligraphic Font" w
\mathcal{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)it" "意大利斜体 Italic Font" r
\mathit{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet it "意大利斜体 Italic Font" w
\mathit{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)sf" "直立无衬线字体 Upright Sans Serif Font" r
\mathsf{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet sf "直立无衬线字体 Upright Sans Serif Font" w
\mathsf{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)fra" "哥特字体 Fraktur Font" r
\mathfrak{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet fra "哥特字体 Fraktur Font" w
\mathfrak{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "([a-zA-Z]+)scr" "花体字 Script Font" r
\mathscr{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet scr "花体字 Script Font" w
\mathscr{${1:${VISUAL}}}
endsnippet

context "math()"
snippet "(\\[a-zA-Z]+|[a-zA-Z]+)bm" "数学粗体 Bold Math Font" r
\bm{`!p snip.rv = match.group(1)`}
endsnippet

context "math()"
snippet bm "数学粗体 Bold Math Font" w
\bm{${1:${VISUAL}}}
endsnippet

context "math()"
snippet dis "展示样式 Display Style" w
\displaystyle 
endsnippet

context "math()"
snippet tes "文本样式 Text Style" w
\textstyle 
endsnippet

context "math()"
snippet lts "Limits" i
\limits
endsnippet
